
#ifndef HAL_PWM_H
#define HAL_PWM_H

#include "hal_types.h"
#include "pwm_lld.h"
#include "emios_lld.h"

typedef enum
{
	PWM0_CHANNEL0 = 0,
	PWM0_CHANNEL1 = 1,
	PWM0_CHANNEL2 = 2,
	PWM0_CHANNEL3 = 3,
	PWM0_CHANNEL4 = 4,
	PWM0_CHANNEL5 = 5,
	PWM0_CHANNEL6 = 6,
	PWM0_CHANNEL7 = 7,
	PWM0_CHANNEL8 = 8,
	PWM0_CHANNEL9 = 9,
	PWM0_CHANNEL10 = 10,
	PWM0_CHANNEL11 = 11,
	PWM0_CHANNEL12 = 12,
	PWM0_CHANNEL13 = 13,
	PWM0_CHANNEL14 = 14,
	PWM0_CHANNEL15 = 15,
	PWM0_CHANNEL16 = 16,
	PWM0_CHANNEL17 = 17,
	PWM0_CHANNEL18 = 18,
	PWM0_CHANNEL19 = 19,
	PWM0_CHANNEL20 = 20,
	PWM0_CHANNEL21 = 21,
	PWM0_CHANNEL22 = 22,
	PWM0_CHANNEL23 = 23,
	PWM0_CHANNEL24 = 24,
	PWM0_CHANNEL25 = 25,
	PWM0_CHANNEL26 = 26,
	PWM0_CHANNEL27 = 27,
	PWM0_CHANNEL28 = 28,
	PWM0_CHANNEL29 = 29,
	PWM0_CHANNEL30 = 30,
	PWM0_CHANNEL31 = 31,
	PWM1_CHANNEL0 = 32,
	PWM1_CHANNEL1 = 33,
	PWM1_CHANNEL2 = 34,
	PWM1_CHANNEL3 = 35,
	PWM1_CHANNEL4 = 36,
	PWM1_CHANNEL5 = 37,
	PWM1_CHANNEL6 = 38,
	PWM1_CHANNEL7 = 39,
	PWM1_CHANNEL8 = 40,
	PWM1_CHANNEL9 = 41,
	PWM1_CHANNEL10 = 42,
	PWM1_CHANNEL11 = 43,
	PWM1_CHANNEL12 = 44,
	PWM1_CHANNEL13 = 45,
	PWM1_CHANNEL14 = 46,
	PWM1_CHANNEL15 = 47,
	PWM1_CHANNEL16 = 48,
	PWM1_CHANNEL17 = 49,
	PWM1_CHANNEL18 = 50,
	PWM1_CHANNEL19 = 51,
	PWM1_CHANNEL20 = 52,
	PWM1_CHANNEL21 = 53,
	PWM1_CHANNEL22 = 54,
	PWM1_CHANNEL23 = 55,
	PWM1_CHANNEL24 = 56,
	PWM1_CHANNEL25 = 57,
	PWM1_CHANNEL26 = 58,
	PWM1_CHANNEL27 = 59,
	PWM1_CHANNEL28 = 60,
	PWM1_CHANNEL29 = 61,
	PWM1_CHANNEL30 = 62,
	PWM1_CHANNEL31 = 63,
	ICU0_CHANNEL0 = 64,
	ICU0_CHANNEL1 = 65,
	ICU0_CHANNEL2 = 66,
	ICU0_CHANNEL3 = 67,
	ICU0_CHANNEL4 = 68,
	ICU0_CHANNEL5 = 69,
	ICU0_CHANNEL6 = 70,
	ICU0_CHANNEL7 = 71,
	ICU0_CHANNEL8 = 72,
	ICU0_CHANNEL9 = 73,
	ICU0_CHANNEL10 = 74,
	ICU0_CHANNEL11 = 75,
	ICU0_CHANNEL12 = 76,
	ICU0_CHANNEL13 = 77,
	ICU0_CHANNEL14 = 78,
	ICU0_CHANNEL15 = 79,
	ICU0_CHANNEL16 = 80,
	ICU0_CHANNEL17 = 81,
	ICU0_CHANNEL18 = 82,
	ICU0_CHANNEL19 = 83,
	ICU0_CHANNEL20 = 84,
	ICU0_CHANNEL21 = 85,
	ICU0_CHANNEL22 = 86,
	ICU0_CHANNEL23 = 87,
	ICU0_CHANNEL24 = 88,
	ICU0_CHANNEL25 = 89,
	ICU0_CHANNEL26 = 90,
	ICU0_CHANNEL27 = 91,
	ICU0_CHANNEL28 = 92,
	ICU0_CHANNEL29 = 93,
	ICU0_CHANNEL30 = 94,
	ICU0_CHANNEL31 = 95,
	ICU1_CHANNEL0 = 96,
	ICU1_CHANNEL1 = 97,
	ICU1_CHANNEL2 = 98,
	ICU1_CHANNEL3 = 99,
	ICU1_CHANNEL4 = 100,	
	ICU1_CHANNEL5 = 101,
	ICU1_CHANNEL6 = 102,
	ICU1_CHANNEL7 = 103,
	ICU1_CHANNEL8 = 104,
	ICU1_CHANNEL9 = 105,
	ICU1_CHANNEL10 = 106,
	ICU1_CHANNEL11 = 107,
	ICU1_CHANNEL12 = 108,
	ICU1_CHANNEL13 = 109,
	ICU1_CHANNEL14 = 110,
	ICU1_CHANNEL15 = 111,
	ICU1_CHANNEL16 = 112,
	ICU1_CHANNEL17 = 113,
	ICU1_CHANNEL18 = 114,
	ICU1_CHANNEL19 = 115,
	ICU1_CHANNEL20 = 116,
	ICU1_CHANNEL21 = 117,
	ICU1_CHANNEL22 = 118,
	ICU1_CHANNEL23 = 119,
	ICU1_CHANNEL24 = 120,
	ICU1_CHANNEL25 = 121,
	ICU1_CHANNEL26 = 122,
	ICU1_CHANNEL27 = 123,
	ICU1_CHANNEL28 = 124,
	ICU1_CHANNEL29 = 125,
	ICU1_CHANNEL30 = 126,
	ICU1_CHANNEL31 = 127
}pwm_channel_en;

void hal_pwm_enabled(pwm_channel_en channel , enabled_en en);
void hal_pwm_duty(pwm_channel_en channel , uint16_t duty);
void hal_pwm_peroid(pwm_channel_en channel , uint32_t peroid);
void hal_pwm_init(pwm_channel_en channel , uint32_t hz , uint16_t duty , enabled_en en);


void hal_capture_init(pwm_channel_en channel ,enabled_en en);
void hal_capture_enabled(pwm_channel_en channle , enabled_en en);
uint32_t hal_pwm_get_period(pwm_channel_en channel);
uint16_t hal_pwm_get_duty(pwm_channel_en channel);
result_en hal_pwm_clock(pwm_channel_en channel ,uint32_t hz);


#endif

